<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML>
<html>
	<head>
		<title>登陆后台</title>
		<!-- Custom Theme files -->
		<link href="css/adminlogin.css" rel="stylesheet" type="text/css" media="all"/>
		<!-- Custom Theme files -->
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<script type="text/javascript" src="js/jquery.min.js"></script>
	</head>
<body>
	<div class="login">
		<h2>登陆后台</h2>
		<div class="login-top">
			<h1>管理员登陆</h1>
			<form id="login-form" action="adminlogin.action" method="post">
				<input id="username" name="user.username" type="text" placeholder="请输入用户名">
				<input id="password" name="user.password" type="password" placeholder="请输入密码">
		    </form>
		    <div class="forgot" style="text-align:center">
		    	<input type="submit" value="登陆" onclick="login()">
		    </div>
		</div>
		<div class="login-bottom">
			
		</div>
	</div>	
	<script>
		function login(){
			if($("#username").val().length<1){
				alert("请输入用户名！");
				return false;
			}
			if($("#password").val().length<1){
				alert("请输入密码！");
				return false;
			}
			$("#login-form").submit();
		}
		
		$(document).ready(function(){
			if("${session.loginUser.type}" == "1"){
				window.location.href = "sys/index.jsp";
			}
		})
	</script>
</body>
</html>